import request from "./request"

// 开播
export function liveList(data){
    return request({
        url: '/echo/live/list',
        method: 'post',
        data,
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 获取直播间信息
export function getLiveRoomById(roomId){
    return request({
        url: '/echo/live/info/'+roomId,
        method: 'get',
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 获取在线人数
export function getLiveUserCount(roomId){
    return request({
        url: '/echo/live/getCount/'+roomId,
        method: 'get'
    })
}

// 开播
export function startLive(data){
    return request({
        url: '/echo/live/living',
        method: 'post',
        data,
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 关播
export function closeLiving(id){
    return request({
        url: '/echo/live/close/'+id,
        method: 'get',
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 获取直播记录
export function getLiveRecord(data){
    return request({
        url: '/echo/liveRecord/list',
        method: 'post',
        data,
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}